import { createApp } from 'vue'
import App from './App.vue'
// import ECharts from 'vue-echarts';
import router from './router/index.js';
// 初始化并连接mqtt
import mq from './utils/initMqtt'
// 引入mitt事件总线
import mitt from 'mitt'
import "echarts"
import ECharts from "vue-echarts"
import svgA from "./components/svgA/index.vue";
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
app.component('v-chart', ECharts)
app.component('svgA', svgA)
app.use(ElementPlus)
// 挂载全局mq
app.provide('$m', mq)
app.provide('$bus', mitt())//全局挂载事件总线
// //定义后端地址（全局变量）
// app.config.globalProperties.$backendUrl = "http://10.134.232.46:8080"
// //mqtt获取数据地址
// app.config.globalProperties.$mqttUrl = "ws://192.168.20.13:8083/mqtt"

//注意use要在mount之前
app.use(router).mount('#app')

